package com.qczl.pme.entity;

import java.io.Serializable;
import java.util.Date;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.Table;

/**
 * 人员类型
 * @author SongR
 *
 */
@Entity
@Table(name="pme_basis_pType")
public class PMEPersonType implements Serializable{
	private static final long serialVersionUID = -3213884246965396241L;
	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	@Column(name = "ptype_id")
	private Long id;
	@Column(name = "ptype_name")
	private String name;
	@Column(name = "ptype_creattime")
	private Date creattime;// 创建时间
	@Column(name = "ptype_status")
	private Integer status;// 状态
	@Column(name = "ptype_sort")
	private Long sort;// 排序
	
	@ManyToMany(cascade = CascadeType.ALL,fetch=FetchType.EAGER)
	@JoinTable(name = "pme_basis_person_type", joinColumns = @JoinColumn(name = "pType_id") , inverseJoinColumns = @JoinColumn(name = "person_id") )
	private Set<PMEPerson> persons;

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Date getCreattime() {
		return creattime;
	}

	public void setCreattime(Date creattime) {
		this.creattime = creattime;
	}

	public Integer getStatus() {
		return status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}

	public Long getSort() {
		return sort;
	}

	public void setSort(Long sort) {
		this.sort = sort;
	}

	public Set<PMEPerson> getPersons() {
		return persons;
	}

	public void setPersons(Set<PMEPerson> persons) {
		this.persons = persons;
	}
}
